home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 008a / xmsif140.zip / XMSIF.HPP < prev    next >
C/C++ Source or Header  |  1991-12-08  |  4KB  |  148 lines

  1. /***************************************************************************
  2. *   XMSIF.HPP                                                              *
  3. *   HEADER FOR XMSIF                                                       *
  4. *   OS:        DOS                                                         *
  5. *   VERSION:   1.1                                                         *
  6. *   DATE:      12/08/91                                                    *
  7. *                                                                          *
  8. *   Copyright (c) 1991 James W. Birdsall. All Rights Reserved.             *
  9. *   Thanks to Bob Parsons of Parsons Technology for this file.             *
  10. *                                                                          *
  11. ***************************************************************************/
  12.  
  13. #ifndef XMSIF_H
  14. #define XMSIF_H
  15.  
  16. /*
  17. ** system includes <>
  18. */
  19.  
  20. /*
  21. ** custom includes ""
  22. */
  23.  
  24. /*
  25. ** local #defines
  26. */
  27.  
  28. /* error returns */
  29.  
  30. #define XMMOOPS     -1
  31. #define NOXMM       -2
  32.  
  33.  
  34. /* XMM library errors */
  35.  
  36. #define XMM_NOINIT          0x40
  37. #define XMM_UMBHUGE         0x41
  38. #define XMM_BADPTR          0x42
  39. #define XMM_ELTOOBIG        0x43
  40. #define XMM_SKTOOBIG        0x44
  41.  
  42.  
  43. /* XMS driver errors */
  44.  
  45. #define XMM_UNIMP           0x80
  46. #define XMM_VDISK           0x81
  47. #define XMM_A20ERROR        0x82
  48. #define XMM_GENERROR        0x8E
  49. #define XMM_UNRECERROR      0x8F
  50.  
  51. #define XMM_NOHMA           0x90
  52. #define XMM_HMAUSED         0x91
  53. #define XMM_HMATOOBIG       0x92
  54. #define XMM_HMANOALLOC      0x93
  55. #define XMM_A20STILLEN      0x94
  56.  
  57. #define XMM_NOFREEX         0xA0
  58. #define XMM_NOFREEXHAN      0xA1
  59. #define XMM_BADXHAN         0xA2
  60. #define XMM_BADSRCHAN       0xA3
  61. #define XMM_BADSRCOFF       0xA4
  62. #define XMM_BADDESTHAN      0xA5
  63. #define XMM_BADDESTOFF      0xA6
  64. #define XMM_BADLENGTH       0xA7
  65. #define XMM_COPYOVERLAP     0xA8
  66. #define XMM_PARITY          0xA9
  67. #define XMM_NOLOCK          0xAA
  68. #define XMM_LOCKED          0xAB
  69. #define XMM_TOOMANYLOCKS    0xAC
  70. #define XMM_LOCKFAIL        0xAD
  71.  
  72. #define XMM_UMBSMALLER      0xB0
  73. #define XMM_NOFREEUMB       0xB1
  74. #define XMM_BADUMBHAN       0xB2
  75.  
  76.  
  77. /* function macros */
  78.  
  79. #define XMMcopyto(clen,src,dhan,doff)    _XMMcopy((clen),0, \
  80.                                             (unsigned long)(src),(dhan),(doff))
  81. #define XMMcopyfrom(clen,shan,soff,dest) _XMMcopy((clen),(shan),(soff),0, \
  82.                                                          (unsigned long)(dest))
  83.  
  84. #define XMMicopyto(n,e,b,s,h,f)          _XMMicopy((n),(e),(b),0, \
  85.                                                 (unsigned long)(s),(h),(f),(b))
  86. #define XMMicopyfrom(n,e,b,h,f,d)        _XMMicopy((n),(e),(b),(h),(f),0, \
  87.                                                             (unsigned long)(d))
  88.  
  89.  
  90. /*
  91. ** misc: copyright strings, version macros, etc.
  92. */
  93.  
  94. /*
  95. ** typedefs
  96. */
  97.  
  98. struct XMMregs {
  99.     unsigned int regAX;
  100.     unsigned int regBX;
  101.     unsigned int regDX;
  102.     unsigned int regSI;
  103.     unsigned int regDS;
  104. };
  105.  
  106.  
  107. /*
  108. ** global variables
  109. */
  110.  
  111. extern unsigned char const _XMMerror;         /* XMS error variable */
  112. extern unsigned int  const _XMMversion;       /* XMS version, BCD */
  113.  
  114. extern char const xmsif_vers_vers[];
  115. extern char const xmsif_vers_date[];
  116. extern char const xmsif_vers_time[];
  117.  
  118.  
  119. /*
  120. ** function prototypes
  121. */
  122.  
  123. extern "C" int XMMlibinit(void);
  124. extern "C" unsigned int XMMgetversion(void);
  125.  
  126. extern "C" unsigned long XMMcoreleft(void);
  127. extern "C" unsigned long XMMallcoreleft(void);
  128.  
  129. extern "C" int XMMalloc(unsigned long bytes);
  130. extern "C" int XMMfree(int handle);
  131.  
  132. extern "C" int _XMMcopy(unsigned long clen,
  133.                         int shan, unsigned long soff,
  134.                         int dhan, unsigned long doff);
  135. extern "C" int _XMMicopy(unsigned long nelem, int elsize,
  136.                          unsigned int sskip, int shan, unsigned long soff,
  137.                          int dhan, unsigned long doff, unsigned int dskip);
  138.  
  139. extern "C" int XMMrawcall(struct XMMregs *regs);
  140.  
  141. extern "C" unsigned long UMBcoreleft(void);
  142. extern "C" unsigned long UMBallcoreleft(void);
  143.  
  144. extern "C" void far *UMBalloc(unsigned long bytes, unsigned long *finalsize);
  145. extern "C" int UMBfree(void far *handle);
  146.  
  147. #endif
  148.